import { defineStore } from 'pinia'
import { reqgetCityAll } from '@/services'

const useCityStore = defineStore('city', {
    // 其他配置...
    state: () => {
      return{
        allCities: {}, //获取所有城市信息
        currentCity: {cityName: "广州"} // 当前城市
      }
    },
    actions: {
        async getCityAllData(){
          const res = await reqgetCityAll()
          this.allCities = res.data   // {}
        }
    }
  })

  export default useCityStore
